<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\select2\Select2;
use kartik\datecontrol\DateControl;
use app\models\GkyUser;

/* @var $this yii\web\View */
/* @var $model app\models\Prize */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="prize-form">
    <h4><?= Html::encode($model->isNewRecord ? '新建获奖>>' : '更新获奖>>') ?></h4>
    <div class="panel panel-default">
        <!--<div class="panel-heading text-center" style="background: #003eff;color:white">prize</div>-->
        <div class="panel-body">
            <?php
            $form = ActiveForm::begin([
                        'options' => ['class' => 'form-horizontal form-group'],
                        'fieldConfig' => [
                            'template' => "{label}<div class=\"col-lg-8\">{input}</div>",
                            'labelOptions' => ['class' => 'col-lg-4', 'style' => 'margin-right:-30px'],
                        ]
            ]);
            ?>

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'projectname')->textInput(['maxlength' => true]) ?>
            </div>
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'prizename')->textInput(['maxlength' => true]) ?>
            </div>
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'prizeno')->textInput(['maxlength' => true]) ?>
            </div>
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'prizetype')->dropDownList(['类型一' => '类型一', '类型二' => '类型二'], ['prompt' => '请选择']) ?>
            </div>
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?php // echo $form->field($model, 'prizedate')->textInput() ?>

                <?=
                $form->field($model, 'prizedate')->widget(DateControl::className(), [
                    //日期组件的类型，是time 还是 date 或者 datetime(前提是要下载好相应的组件)
                    'type' => DateControl::FORMAT_DATE,
                    'ajaxConversion' => false,
                    'options' => [
                        'pluginOptions' => [
                            'autoclose' => true,
                            //设置开始日期
                            'startDate' => date(date('Y-m-d')),
                            //设置结束日期
                            // 'endDate' => '2025-09-29',
                            //当前日期高亮显示
                            'todayHighlight' => true
                        ],
                        'options' => ['placeholder' => isset($model->prizedate) ? $model->prizedate : '请选择时间'],
                    ]
                        ]
                )
                ?>

            </div>

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'prizedept')->textInput(['maxlength' => true]) ?>
            </div>

<!--            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'prizelevel')->textInput(['maxlength' => true]) ?>
            </div>-->

            

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'prizelevel')->dropDownList(['一等奖' => '一等奖', '二等奖' => '二等奖', '三等奖' => '三等奖'], ['prompt' => '请选择']) ?>
            </div>

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'isfinish')->dropDownList(['1' => '是', '0' => '否'], ['prompt' => '请选择']) ?>
            </div>

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?= $form->field($model, 'mark')->textInput(['maxlength' => true]) ?>
            </div>


            <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
                <div class="form-group">
                    <?= Html::submitButton('保存', ['class' => 'btn btn-success col-lg-offset-5 col-md-offset-5']) ?>
                    <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
                </div>
            </div>

            <?php ActiveForm::end(); ?>
        </div>


    </div>
    
</div>
    
